'use strict'
const express = require('express')
const pkg = require('../../package.json')
const controller = require('../controller')
const router = express.Router()

router.get('/', (req, res) => {
  res.send('BackEnd Server v' + pkg.version)
  res.end()
})

router.get('/session', (req, res) => {
  req.session.views = req.session.views ? (req.session.views + 1) : 1
  res.send(req.session)
})

router.get('/home', controller.home.index)

module.exports = router
